import sys,time
import os

from Predict_FESJob import Predict_FESJob

def main(bf_no,avg_iron_temp,avg_c_s_value,compute_slag_rate,compute_fill_s_value):
    y_pred_output = ''
    try:
        bf_no = int(bf_no)
        avg_iron_temp = float(avg_iron_temp)
        avg_c_s_value = float(avg_c_s_value)
        compute_slag_rate = float(compute_slag_rate)
        compute_fill_s_value = float(compute_fill_s_value)
        success_tmp = True
        msg = ''
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    except Exception as e:
        success_tmp = False
        msg = f'invalid_parameter_type--{str(e)}'
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    if success_tmp:
        # try:
        #     y_pred_output = Predict_FESJob(p_bf_no = bf_no,p_avg_iron_temp = avg_iron_temp,p_avg_c_s_value = avg_c_s_value,p_compute_slag_rate = compute_slag_rate,p_compute_fill_s_value = compute_fill_s_value).execute()
        #     timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
        #     msg = ''
        #     success_tmp = True
        # except Exception as e:
        #     success_tmp = False
        #     msg = f'run_model_job_failed---with--{str(e)}'
        #     timestamp = None
        y_pred_output = Predict_FESJob(p_bf_no=bf_no, p_avg_iron_temp=avg_iron_temp, p_avg_c_s_value=avg_c_s_value, p_compute_slag_rate=compute_slag_rate, p_compute_fill_s_value=compute_fill_s_value).execute()
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
        success_tmp = True
    success = success_tmp
    message = msg
    timestamp = timestamp
    y_pred_output = y_pred_output
    return success, message, timestamp, y_pred_output
if __name__ == '__main__':
    bf_no = 1
    avg_iron_temp = 1511
    avg_c_s_value = 122
    compute_slag_rate = 303
    compute_fill_s_value = 349
    success, message, timestamp, y_pred_output = main(bf_no,avg_iron_temp,avg_c_s_value,compute_slag_rate,compute_fill_s_value)
    print(success, message, timestamp, y_pred_output)
